#pragma once

#include "HSViewApi.h"
#include "Ogre.h"

namespace OIS
  {
  class KeyEvent;
  }

enum EZoomDirection
  {
  ZD_OUT = -1,
  ZD_NONE = 0,
  ZD_IN = 1
  };

class GeneralCamera
  {
  public:
    GeneralCamera(Ogre::Camera* i_cam);
    bool FrameRenderingQueued(const Ogre::FrameEvent& i_evt);
    void InjectKeyDown (const OIS::KeyEvent& i_evt);
    void InjectKeyUp (const OIS::KeyEvent& i_evt);
    void SetBoarders(Ogre::Real i_xlower, Ogre::Real i_xupper, Ogre::Real i_ylower, Ogre::Real i_yupper, Ogre::Real i_zlower, Ogre::Real i_zupper);
    Ogre::Ray GetDirectionRay(Ogre::Real i_screen_x, Ogre::Real i_screen_y);
  private:
    Ogre::Camera* mp_cam;
    Ogre::Real m_top_speed;
    Ogre::Vector3 m_velocity;
    bool m_going_forward;
    bool m_going_back;
    bool m_going_right;
    bool m_going_left;
    bool m_rotating_right;
    bool m_rotating_left;
    bool m_rotating_up;
    bool m_rotating_down;
    Ogre::Real m_x_lowerboarder;
    Ogre::Real m_x_upperboarder;
    Ogre::Real m_y_lowerboarder;
    Ogre::Real m_y_upperboarder;
    Ogre::Real m_z_lowerboarder;
    Ogre::Real m_z_upperboarder;

    EZoomDirection m_zoom_direction;
  };